package com.meringer.beans.ejb;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.meringer.entities.Race;
import com.meringer.entities.User;
import com.meringer.utils.CarAndModel;

@Stateless
@LocalBean
public class ProfileEJB {

	@PersistenceContext
	private EntityManager em;
	@EJB
	UserEJB userEJB;

    public ProfileEJB() {
        
    }
    public void updateUserImg(String imgPath){
    	User currentUser = userEJB.currentUser();
    	currentUser.setImgPath(imgPath);
    	userEJB.updateCurrentUser(currentUser);
    }
    public void updateUserNameAndAge(String realname, Integer age){
    	User currentUser = userEJB.currentUser();
    	currentUser.setRealName(realname);
    	currentUser.setAge(age);
    }
//    public UserLastRaces getRaceResults(){
//    	List<UserLastRaces> results;
//    	User currentUser = userEJB.currentUser();
//    	List<Race> userRaces = currentUser.getRaces();
//    	
//    }
    

}
